package com.example.practical_training_projects.controller;

import com.example.practical_training_projects.entity.working_schedule;
import com.example.practical_training_projects.service.work_scheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("workschedule")
public class work_scheduleController {
    @Autowired
    private work_scheduleService service;
    @PostMapping("inserttime")
    public Integer insertworktime(@RequestBody working_schedule work){
        return service.insertworktime(work);
    }

    @GetMapping("selectpcwork/{pc_uid}")
    public List<working_schedule> selectpcwork(@PathVariable("pc_uid")Integer pc_uid){
        return service.selectpcwork(pc_uid);
    }

    @GetMapping("deletepcwork/{ws_id}")
    public Integer deletepcworkbyid(@PathVariable Integer ws_id){
        return service.deletepcworkbyid(ws_id);
    }

}
